def find_max_and_positions():
    n = int(input())
    numbers = []
    for _ in range(n):
        num = int(input())
        numbers.append(num)
    max_value = max(numbers)
    positions = [i + 1 for i, num in enumerate(numbers) if num == max_value]
    print(max_value)
    for pos in positions:
        print(pos)

find_max_and_positions()